package com.kkwrite.regimen.common.entity.dto.order;

import java.io.Serializable;

/**
 * Created by lisha on 2018/7/26 15:29.
 *
 * @author lisha
 */
public class SubmitOrderInDTO implements Serializable {
    private static final long serialVersionUID = 4412274959821588124L;

    private Short orderType;
    private Integer itemId;
    private Integer shopId;
    private Integer num;
    private Double price;
    private String phoneNum;

    public boolean isOk() {
        if (itemId == null || itemId <= 0 || shopId == null || shopId <= 0) {
            return false;
        }
        if (num == null || num < 1) {
            return false;
        }
        if (price == null || price < 0) {
            return false;
        }
        return phoneNum != null && !phoneNum.isEmpty();
    }

    public boolean isNotOk() {
        return !isOk();
    }

    public Integer getItemId() {
        return itemId;
    }

    public void setItemId(Integer itemId) {
        this.itemId = itemId;
    }

    public Integer getShopId() {
        return shopId;
    }

    public void setShopId(Integer shopId) {
        this.shopId = shopId;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public String getPhoneNum() {
        return phoneNum;
    }

    public void setPhoneNum(String phoneNum) {
        this.phoneNum = phoneNum;
    }

    public Short getOrderType() {
        return orderType;
    }

    public void setOrderType(Short orderType) {
        this.orderType = orderType;
    }

    @Override
    public String toString() {
        return "SubmitOrderInDTO{" +
                "orderType=" + orderType +
                ", itemId=" + itemId +
                ", shopId=" + shopId +
                ", num=" + num +
                ", price=" + price +
                ", phoneNum='" + phoneNum + '\'' +
                '}';
    }
}
